package pers.jg.rrsserver

import org.bouncycastle.jce.provider.BouncyCastleProvider
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.web.bind.annotation.CrossOrigin
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController
import java.nio.charset.StandardCharsets
import java.security.Security
import java.util.*
import javax.crypto.Cipher
import javax.crypto.spec.SecretKeySpec


@SpringBootApplication
class RrsServerApplication

fun main(args: Array<String>) {
    runApplication<RrsServerApplication>(*args)

//    const key = '3qq8cn[\'qhdYaq\';34as808,7;\'AUH8h87g7qdh;\'r3w87ihkY01dYeu'
//    const keyHex = cryptoJs.enc.Utf8.parse(key)
//    const pwEncrypted = cryptoJs.TripleDES.encrypt(password, keyHex,
//    {
//            mode: cryptoJs.mode.ECB,
//            padding: cryptoJs.pad.Pkcs7,
//    }
//    )

    //    todo uuidv4


}

@RestController
@CrossOrigin
class SampleController {

    @GetMapping("/")
    fun index(): String {
        return "RRS Index"
    }

    @GetMapping("/api")
    fun api(): String {
        return "RRS Api"
    }

}


